<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

<script type="text/javascript">
	
	//浏览器窗口的宽度
	console.log(window.innerWidth)

	//浏览器可见区域宽度
	console.log(document.documentElement.clientWidth)
	//body的宽度
	console.log(document.body.clientWidth)

	//兼容性写法
	let width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth

	//高度
	let heigth = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight

</script>
</body>
</html>